#include <func.h>
void newhand(int signum,siginfo_t *siginfo,void* ss)
{
    printf("sig2 is coming\n");
}
int main(int argc,char **argv)
{
    struct sigaction act;
    memset(&act,0,sizeof(act));
    act.sa_flags = SA_SIGINFO;
    act.sa_sigaction = newhand;
    sigaction(SIGINT,&act,NULL);

    sigset_t sigSet;
    sigemptyset(&sigSet);
    sigaddset(&sigSet,SIGINT);
    sigprocmask(SIG_BLOCK,&sigSet,NULL);
    printf("sig2 is blocked,sleep 5 secs\n");
    sleep(5);
    sigset_t pending;
    sigpending(&pending);
    if(sigismember(&pending,SIGINT))
    {
        printf("sig2 is pending\n");
    }else{
        printf("no pending\n");
    }
    printf("now unblock sig2...\n");
    sigprocmask(SIG_UNBLOCK,&sigSet,NULL);
    return 0;
}

